home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 5191 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.5 KB

  1. X-Mailer: MicroDot 1.10 [UNREGISTRIERT] via [DOS/NCBMail V2.21 REL.:160995]
  2. Message-ID: <xRL9hMD0aRz1@point86.people-s.people.de>
  3. Organization: Artwork Demo Factories ..
  4. References: <38232442@kone.fipnet.fi> <4h45g4$ije@sunsystem5.informatik.tu-muenchen.de>
  5. X-Gateway: ZCONNECT UU people-s.people.de [DUUCP vom 01.07.1994]
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=ISO-8859-1
  8. Content-Transfer-Encoding: 8bit
  9. From: azure@people-s.people.de (Tim Boescke)
  10. Subject: Re: TMapping again!
  11. Date: 11 Mar 1996 23:03:45 +0100
  12. Path: people-s.people.de!azure
  13. Newsgroups: comp.sys.amiga.programmer
  14. Distribution: world
  15.  
  16. Reply to Re: TMapping again! / 29.02.1996
  17. by fischerj@informatik.tu-muenchen.de (Juergen Rally Fischer)
  18. JF> In article <38232567@kone.fipnet.fi>, "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi> writes:
  19. JF> |> 
  20. JF> |> >     A time ago I did an approach to this problem using a similar trick
  21. JF> |> >     than my two-command mapper.
  22. JF> |> >     (btw. actually this one WORKS .. I have tried it out)
  23. JF> |> > 
  24. JF> |> > 
  25. JF> |> >         move.l  d3,d2           ;d3=d4=0000000000000XXXXXXXxxxxxxYYYYYY
  26. JF> |> >         move    d0,d5           ;d0=a6=yyyyyyyy000000000000BBBBBBbbbbbb
  27. JF> |> >         and.l   d6,d2           ;d6=   00000000000001111111000000111111
  28. JF> |> >         and.b   d7,d5           ;d7=   xxxxxxxxxxxxxxxxxxxxxxxx11000000
  29. JF> |> >         or      d5,d2
  30. JF> |> >         move.b  (a4,d2.l),(a2)+ ;d2=   00000000000000xxxxxxbbbbbbyyyyyy
  31. JF> |> >         add.l   a6,d0
  32. JF> |> >         addx.l  d4,d3
  33. JF> |> > 
  34. JF> |> >      This one is doing Texturemapping + gouraud shading with
  35. JF> |> >      shadetable. (!!)
  36. JF> |> > 
  37. JF> |> >      The Texture is 64x64 (6 bit) and the shading is 6 bit two. You
  38. JF> |> >      will need a 256k combined Texture/Shading table.
  39. JF> |> 
  40. JF> |> Hmm. Not nice in a game for example where several textures
  41. JF> |> are needed. But a nice idea anyway!
  42.  
  43.     YOu can use this code with several textures. For example you could
  44.     split up the shading range. For example B=0-31 is textere one and
  45.     B=32-63 is Texture two.. etc. or use 32x32 textures...
  46.  
  47. JF> nice ? Cooooooool! 
  48. JF> Cool idea to pack the shading value into the texture adress!
  49.  
  50.     Thanks ;)
  51.  
  52. JF> The example does too much instructions :) but allows more general
  53. JF> mem usage.
  54. JF> 
  55. JF> What about this...
  56. JF> 
  57. JF>  add.l  a2,d2          0...00BBBbbbbbbbbbbbbbbbb
  58. JF>  add.l  a3,d1          x...xxxxxYYYYYYYYyyyyyyyy
  59. JF>  addx.l d3,d0          0...0000000000000XXXXXXXX
  60. JF>  move.l d2,d6
  61. JF>  move.w d1,d6
  62. JF>  move.b d0,d6
  63. JF>  move.b 0(a0,d6.l),(a1)+
  64. JF> 
  65. JF> 20 cycles gouraud mapping :)
  66. JF> 
  67. JF> 8 shadingsteps are 512k, not too much even for a A1200 game imho 
  68. JF> (well, people tell me they aim for higher machines anyway,
  69. JF> so the mem consumption can't be considered so bad ;)
  70.  
  71.     Welll. of course this is two cycles faster, but it takes twice the
  72.     memory and 8 shading steps are simply not enough ;)
  73.  
  74. JF> I would really think about using this routine, it's really LOT quicker.
  75. JF> You can put multiple textures into a given 64k range btw. but those can't
  76. JF> be "repeart-mapped" uh "multiplexed" ? how you call it if x gets 256 and then
  77. JF> _plop_, 0 again on the left side ? Is this called bump-mapping ? :D
  78.  
  79.     wrap-around textures ?? Well erhm.. Bump-mapping is a bit different.
  80.     (hehe found a nice and fast innerloop for that, too. ;) )
  81.  
  82. --
  83.     +--------------------------------------------------------------------+
  84.     |      -  AZURE@PEOPLE-S.people.de - Tim Boescke - AZURE /atw.bzr    |
  85.     +---------------------------------<AMIGA,PC,C64,PLUS/4,VCS2600>------+
  86.